// 导入页面组件
import frame from "@/views/main/frame.vue";
import myabsent from "@/views/absent/my.vue";
import subabsent from "@/views/absent/sub.vue";
import informpublish from "@/views/inform/publish.vue";
import informlist from "@/views/inform/list.vue";
import informdetail from "@/views/inform/detail.vue";
import stafflist from "@/views/staff/list.vue";
import staffadd from "@/views/staff/add.vue";
import home from "@/views/home/home.vue";
import absent_index from "@/views/absent/index.vue";
import inform_index from "@/views/inform/index.vue";
import staff_index from "@/views/staff/index.vue";

// 定义路由配置
const routes = [
  {
    path: "/",
    name: "frame",
    component: frame,
    children: [
      {
        path: "/",
        component: home,
        name: "home",
        meta: {
          icon: "HomeFilled",
          text: "首页",
        },
      },
      {
        path: "absent",
        component: absent_index,
        name: "absent",
        meta: {
          icon: "Calendar",
          text: "考勤管理",
        },
        children: [
          {
            path: "my",
            name: "myabsent",
            component: myabsent,
            meta: {
              icon: "User",
              text: "我的考勤",
            },
          },
          {
            path: "sub",
            name: "subabsent",
            component: subabsent,
            meta: {
              icon: "UserFilled",
              text: "下属考勤",
            },
          },
        ],
      },
      {
        path: "inform",
        component: inform_index,
        name: "inform",
        meta: {
          icon: "Memo",
          text: "通知管理",
        },
        children: [
          {
            path: "publish",
            name: "informpublish",
            component: informpublish,
            meta: {
              icon: "CirclePlusFilled",
              text: "发布通知",
            },
          },
          {
            path: "list",
            name: "informlist",
            component: informlist,
            meta: {
              icon: "List",
              text: "通知列表",
            },
          },
          {
            path: "detail/:pk",
            name: "informdetail",
            component: informdetail,
            meta:{
               hidden : true 
            }
          },
        ],
      },
      {
        path: "staff",
        component: staff_index,
        name: "staff",
        meta: {
          icon: "Avatar",
          text: "员工管理"
        },
        children: [
          {
            path: "add",
            name: "staffadd",
            component: staffadd,
            meta: {
              icon: "CirclePlusFilled",
              text: "新增员工"
            }
          },
          {
            path: "list",
            name: "stafflist",
            component: stafflist,
            meta: {
              icon: "Avatar",
              text: "员工列表"
            }
          }
        ]
      },
    ],
  },
];

export default routes;